<template>
  <div>
    <div
      v-if="title"
      class="van-cell-group__title"
    >
      {{ title }}
    </div>
    <div class="custom-class van-cell-group" :class="{'van-hairline--top-bottom':border}">
      <slot/>
    </div>
  </div>
</template>

<script>
export default {
  name: 'layout-cell-group',
  props: {
    title: String,
    border: {
      type: Boolean,
      value: true
    }
  }
}
</script>

<style lang="scss" scoped>
  .van-cell {
    position: relative;
    display: -webkit-flex;
    display: flex;
    box-sizing: border-box;
    width: 100%;
    padding: 10px 16px;
    padding: var(--cell-vertical-padding, 10px) var(--cell-horizontal-padding, 16px);
    font-size: 14px;
    font-size: var(--cell-font-size, 14px);
    line-height: 24px;
    line-height: var(--cell-line-height, 24px);
    color: #323233;
    color: var(--cell-text-color, #323233);
    background-color: #fff;
    background-color: var(--cell-background-color, #fff)
  }

  .van-cell:after {
    position: absolute;
    box-sizing: border-box;
    -webkit-transform-origin: center;
    transform-origin: center;
    content: " ";
    pointer-events: none;
    top: auto;
    right: 0;
    bottom: 0;
    left: 16px;
    border-bottom: 1px solid #ebedf0;
    -webkit-transform: scaleY(.5);
    transform: scaleY(.5)
  }

  .van-cell--borderless:after {
    display: none
  }

  .van-cell-group {
    background-color: #fff;
    background-color: var(--cell-background-color, #fff)
  }

  .van-cell__label {
    margin-top: 3px;
    margin-top: var(--cell-label-margin-top, 3px);
    font-size: 12px;
    font-size: var(--cell-label-font-size, 12px);
    line-height: 18px;
    line-height: var(--cell-label-line-height, 18px);
    color: #969799;
    color: var(--cell-label-color, #969799)
  }

  .van-cell__value {
    overflow: hidden;
    text-align: right;
    vertical-align: middle;
    color: #969799;
    color: var(--cell-value-color, #969799)
  }

  .van-cell__title, .van-cell__value {
    -webkit-flex: 1;
    flex: 1
  }

  .van-cell__title:empty, .van-cell__value:empty {
    display: none
  }

  .van-cell__left-icon-wrap, .van-cell__right-icon-wrap {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    height: 24px;
    height: var(--cell-line-height, 24px);
    font-size: 16px;
    font-size: var(--cell-icon-size, 16px)
  }

  .van-cell__left-icon-wrap {
    margin-right: 5px
  }

  .van-cell__right-icon-wrap {
    margin-left: 5px;
    color: #969799;
    color: var(--cell-right-icon-color, #969799)
  }

  .van-cell__left-icon {
    vertical-align: middle
  }

  .van-cell__left-icon, .van-cell__right-icon {
    line-height: 24px;
    line-height: var(--cell-line-height, 24px)
  }

  .van-cell--clickable.van-cell--hover {
    background-color: #f2f3f5;
    background-color: var(--cell-active-color, #f2f3f5)
  }

  .van-cell--required {
    overflow: visible
  }

  .van-cell--required:before {
    position: absolute;
    content: "*";
    left: 8px;
    left: var(--padding-xs, 8px);
    font-size: 14px;
    font-size: var(--cell-font-size, 14px);
    color: #ee0a24;
    color: var(--cell-required-color, #ee0a24)
  }

  .van-cell--center {
    -webkit-align-items: center;
    align-items: center
  }

  .van-cell--large {
    padding-top: 12px;
    padding-top: var(--cell-large-vertical-padding, 12px);
    padding-bottom: 12px;
    padding-bottom: var(--cell-large-vertical-padding, 12px)
  }

  .van-cell--large .van-cell__title {
    font-size: 16px;
    font-size: var(--cell-large-title-font-size, 16px)
  }

  .van-cell--large .van-cell__value {
    font-size: 16px;
    font-size: var(--cell-large-value-font-size, 16px)
  }

  .van-cell--large .van-cell__label {
    font-size: 14px;
    font-size: var(--cell-large-label-font-size, 14px)
  }
</style>
